<template>
	<view>
		<nav-box :title="title" :borderBottom="true"></nav-box>
		<view class="list-box">
			<block v-for="item in list" :key="item.id">
				<view class="item-box" @click="toDetail(item)">
					<view class="left-box">
						<text>{{ item.title }}</text>
						<text>{{ item.date }}</text>
					</view>
					<image src="../../static/images/forward.png" mode=""></image>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			title: '',
			list: [
				//培训任务列表
				{
					id: 1,
					title: '培训任务1',
					date: '2021/02/03'
				},
				{
					id: 2,
					title: '培训任务2',
					date: '2021/02/03'
				},
				{
					id: 3,
					title: '培训任务3',
					date: '2021/02/03'
				}
			]
		};
	},
	onLoad(options) {
		this.title = options.title;
	},
	methods: {
		toDetail(id) {
			uni.navigateTo({
				url: '../trainingTasksDetail/trainingTasksDetail?id=' + id
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.list-box {
	background-color: #ffffff;
	.item-box {
		padding: 30upx;
		border-bottom: 2upx solid #f1f1f1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		image {
			width: 40upx;
			height: 40upx;
			padding-left: 30upx;
		}
		text {
			display: block;
			font-size: 32upx;
			color: #4b4b4b;
			&:last-child {
				margin-top: 15upx;
				font-size: 28upx;
				color: #7e7e7e;
			}
		}
	}
}
</style>
